<style>
#box
{
    width: 100px;
    height: 100px;
    background-color: aqua;
}
</style>
<body>
    <div id="box"></div>
</body>
<script>
var obox = document.getElementById('box')

obox.onclick= function(){
    console.log(1)
}
obox.onclick= function(){
    console.log(2)
}
obox.addEventListener('click',function(){
    console.log(1)
})
obox.addEventListener('click',function(){
    console.log(2)
})
</script>